package com.shangxian.giveithome.code;

import lombok.Getter;

@Getter
public enum UserCode implements Code {

    USER_EXISTENCE(false, 1000, "用户已存在"),
    USER_NOT_EXIST(false, 1001, "暂无此用户"),
    USER_UPDATE_ERROR(false, 1002, "用户信息更新失败,请稍后重试"),
    USER_DATA_ERROR(false, 1003, "修改用户数据异常"),
    USER_AUTH_ERROR(false, 1004, "您无权修改他人信息"),
    USER_DETAILS_ERROR(false, 1005, "您无权查看他人信息"),
    USER_IS_AUDIT(false, 1006, "您已被封禁"),
    USER_AUDIT_FAIL(false, 1007, "用户封禁失败"),
    USER_NULL_AUDIT(false, 1008, "用户未被禁用"),
    USER_UNBLOCK_FAIL(false, 1009, "用户解除禁用失败"),
    USER_AREADY_AUDIT(false, 10010, "用户已经被封禁");

    private boolean success;

    private Integer code;

    private String message;

    UserCode(boolean success, Integer code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return this.success;
    }

    @Override
    public int code() {
        return this.code;
    }

    @Override
    public String message() {
        return this.message;
    }
}
